package com.lz.yz.reward.service.impl;

import com.lz.yz.base.entity.ReturnValue;
import com.lz.yz.core.AbstractService;
import com.lz.yz.reward.dao.ComplaintsMapper;
import com.lz.yz.reward.entity.Complaints;
import com.lz.yz.reward.model.ComplaintsModel;
import com.lz.yz.reward.service.ComplaintsService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * ${DESCRIPTION}
 *
 * @author gaoran
 * @create 2017-12-18 11:45
 **/
@Service
@Transactional
public class ComplaintsServiceImpl extends AbstractService<Complaints> implements ComplaintsService {

    @Resource
    private ComplaintsMapper complaintsMapper;


    @Override
    public ReturnValue add(ComplaintsModel complaintsModel) {
        Complaints complaints=new Complaints();
        BeanUtils.copyProperties(complaintsModel,complaints);
        complaintsMapper.insertSelective(complaints);
        return   ReturnValue.generateTrueMsgReturnValue("提交投诉成功");
    }
}
